#include "stdafx.h"
#include <iostream>
#include <time.h>
#define NC 10
#define NR 5
using namespace std;
void genera(char matr[][NR]);
void visualiza(char matr[][NR]);
void ordina(char matr[][NR]);
int main()
{
    return 0;
}

void genera(char matr[][NR]) {
	for (int i = 0; i < NR; i++) {
		for (int j = 0; j < NC; j++) {
			matr[i][j] = 'A' + rand() % ('Z');
		}
	}
}
void visualiza(char matr[][NR]) {
	for (int i = 0; i < NR; i++) {
		for (int j = 0; j <NC ; j++) {
			printf("%c", matr[i][j]);
		}
		printf("\n");
	}
}

void ordina(char matr[][NR]) {


	char temp = 0;
	int c_i = 0;

	for (int i = 0; i < NR; i++) {
		for (int j = 0; j < NC; j++) {
			for (int k = i; k < NR; k++) {
				if (k == j) {
					c_i = j;
				}
				else {
					c_i = 0;
				}
				for (int v = c_i; v < NC; v++) {
					if (matr[i][j] > matr[k][v]) {
						temp = matr[k][v];
						matr[k][v] = matr[i][j];
						matr[i][j] = temp;

					}
				}
			}
		}
	}
}